/* 管理界面样式 */
/* Admin interface styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 登录界面样式 */
/* Login page styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    position: relative;
}

/* 语言切换按钮 */
/* Language switch button */
.language-switch {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.language-switch a {
    color: #667eea;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border: 1px solid #667eea;
    border-radius: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.language-switch a:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.error {
    background: #ff6b6b;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* 管理界面布局 */
/* Admin interface layout */
.admin-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: #2c3e50;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 管理界面语言切换 */
/* Admin interface language switch */
.admin-header .language-switch {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.admin-header .language-switch a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border: 1px solid #ecf0f1;
    border-radius: 15px;
    transition: all 0.3s ease;
    background: rgba(236, 240, 241, 0.1);
}

.admin-header .language-switch a:hover {
    background: rgba(236, 240, 241, 0.2);
    transform: translateY(-1px);
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.header-actions a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.header-actions a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-main {
    flex: 1;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 生成区域样式 */
/* Generation area styles */
.generate-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.generate-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

.generate-form {
    display: flex;
    flex-direction: column;
}

.form-row {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    padding: 10px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    min-width: 200px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    height: fit-content;
}

button:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* 表格区域样式 */
.codes-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.codes-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

.table-container {
    overflow-x: auto;
}

.codes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.codes-table th,
.codes-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.codes-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
}

.codes-table tr:hover {
    background: #f8f9fa;
}

.code-cell {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #e74c3c;
    font-size: 16px;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.actions {
    white-space: nowrap;
}

.actions button {
    padding: 6px 12px;
    margin-right: 8px;
    font-size: 12px;
}

.btn-toggle {
    background: #28a745;
}

.btn-toggle:hover {
    background: #218838;
}

.btn-delete {
    background: #dc3545;
}

.btn-delete:hover {
    background: #c82333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .admin-main {
        padding: 20px 15px;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group input {
        min-width: auto;
    }
    
    .codes-table {
        font-size: 14px;
    }
    
    .codes-table th,
    .codes-table td {
        padding: 8px 10px;
    }
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.generate-section,
.codes-section {
    animation: slideIn 0.5s ease-out;
}

/* 成功提示样式 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}